<?php 

use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;

// 自动加载类
require_once GKROOT . '/vendor/autoload.php';
// 配置文件
global $config;
$config = require __DIR__ . '/config.php';

// 设置woker 根目录
define('WORKER_ROOT', __DIR__);
//var_dump(WORKER_ROOT);
// bussinessWorker 进程
$worker = new BusinessWorker();
// worker名称
$worker->name = $config['woker']['woker_name'];
// bussinessWorker进程数量
$worker->count = $config['woker']['woker_nums'];
// 服务注册地址
$worker->registerAddress = $config['registerAddress'];

// 如果不是在根目录启动，则运行runAll方法
if(!defined('GLOBAL_START'))
{
    Worker::runAll();
}

